<?php
include_once 'db.class.php';
class Dashboard extends DB
{
    function   __construct()
   {
       //echo "Object Created";
   }

   /* Common function to return rows from any table
    * Arguments Table name as $tbl_name
    * $tbl_key - if passed will make this field as Arrray Key , else will makes a default incremented value use null if a condition is there
    * $condition - any where condition or limit that should be concatinated with the string
    */
    function Get_Table_Rows($tbl_name,$tbl_key=null,$condition="")
    {
        $i=0;  $ReturnArray=array();
        $sql="select * from ".$tbl_name." ".$condition;
        $result=$this->query($sql);
        while($row=$this->fetchNextObject($result))
        {
            $ArrayKey=isset($tbl_key) ? $row->$tbl_key : $i++ ;
            foreach ($row as $field => $value)
              $ReturnArray[$ArrayKey][$field]=$value;
        }
    return $ReturnArray;
    }

}
?>